package ua.org.cityid.shared.events;

import java.util.List;

import ua.org.cityid.shared.data.City;

import com.google.gwt.event.shared.GwtEvent;

public class CitiesFetchedEvent extends GwtEvent<CitiesFetchedHandler> {

	public static final Type<CitiesFetchedHandler> TYPE = new Type<CitiesFetchedHandler>();
	
	private final List<City> _cities;
	
	public CitiesFetchedEvent(List<City> cities){
		_cities = cities;
	}
	
	@Override
	protected void dispatch(final CitiesFetchedHandler handler) {
		handler.onCitiesFetched(_cities);
	}

	@Override
	public Type<CitiesFetchedHandler> getAssociatedType() {
		return TYPE;
	}

}
